<template>
  <!-- 计算工资 -->
  <div>
    <button class="btn" @click="salary(0)">发工资啦，我的工资是3000</button
    ><br />
    <button class="btn" @click="salary(-2800)">
      给喜欢的女主播刷了火箭-2800</button
    ><br />
    <button class="btn" @click="salary(10000)">送外卖赚了10000</button><br />
    <button class="btn" @click="salary(-18000)">
      给暗恋的女生买了爱马仕-18000</button
    ><br />
    <button class="btn" @click="salary(8000)">晚上去做代驾赚了8000</button
    ><br />
    <button class="btn" @click="salary(-100)">买泡面100</button><br />
    <button class="btn" @click="salary(-50)">买挂逼水50</button>
    <p>我是舔狗，我这个月还有{{ money }}元</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      money: 3000,
    }
  },
  methods: {
    salary(n) {
      console.log((this.money += n))
    },
  },
}
</script>

<style>
.btn {
  width: 250px;
}
</style>
